package com.myjob.enums;

/**
 * @author chenyuan
 * @date 2021/1/12 22:23
 */
public class UserEnums {
    /**
     * 技能掌握程度
     * '精通：1','熟练：2','基本掌握：3','一般：4','了解：5'
     */
    public enum SKILL_DEGREE{
        //
        master("1", "精通"),
        skilled("2", "熟练"),
        mastery("3", "基本掌握"),
        commonly("4", "一般"),
        understand("5", "了解");

        private String key;
        private String value;

        SKILL_DEGREE(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public String getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getCode(String name) {
            for (SKILL_DEGREE c : SKILL_DEGREE.values()) {
                if (c.value.equals(name)) {
                    return c.key;
                }
            }
            return null;
        }
    }

    /**
     * 用户角色
     * '超级管理员:1','管理员:2','应聘者:3','企业:4','HR:5'
     */
    public enum ROLE{
        //
        super_manager("1","超级管理员"),
        manager("2", "管理员"),
        candidate("3", "应聘者"),
        company("4", "企业"),
        hr("5", "HR");

        private String key;
        private String value;

        ROLE(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public String getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getCode(String name) {
            for (ROLE c : ROLE.values()) {
                if (c.value.equals(name)) {
                    return c.key;
                }
            }
            return null;
        }
    }


    /**
     * 性别 男：1  女：2
     */
    public enum USER_SEX{
        // 男
        male("1", "男"),
        // 女
        female("2", "女");

        private String key;
        private String value;

        USER_SEX(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public String getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getCode(String name) {
            for (USER_SEX c : USER_SEX.values()) {
                if (c.value.equals(name)) {
                    return c.key;
                }
            }
            return null;
        }
    }

    /**
     * 企业在系统中的状态
     * '正常：1','暂停：2','停止：3'
     */
    public enum ACCOUNT_STATUS{
        //
        normal("1", "正常"),
        suspend("2", "暂停"),
        leave("3", "停止");

        private String key;
        private String value;

        ACCOUNT_STATUS(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public String getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getCode(String name) {
            for (ACCOUNT_STATUS c : ACCOUNT_STATUS.values()) {
                if (c.value.equals(name)) {
                    return c.key;
                }
            }
            return null;
        }
    }


    /**
     * 广告等级
     * '一级：1','二级：2'
     */
    public enum ADV_LEVEL{
        //
        one("1", "一级"),
        two("2", "二级");

        private String key;
        private String value;

        ADV_LEVEL(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public String getKey() {
            return key;
        }

        public String getValue() {
            return value;
        }

        public static String getCode(String name) {
            for (ACCOUNT_STATUS c : ACCOUNT_STATUS.values()) {
                if (c.value.equals(name)) {
                    return c.key;
                }
            }
            return null;
        }
    }
}
